#include<bits/stdc++.h>
using namespace std ;
int main(int argc,char *argv[])
{
    char k[100];int w=0;
    bool x; if(!argv[1]) x=1;
    if(!x) strcpy(k,argv[1]);
    if(!x) w=atoi(argv[2]);
    system("g++ -o mkg data_graph.cpp\n");
    if(x) system("mkg");
    else if(k[0]=='q') system("mkg q");
    else if(k[0]=='w') system("mkg w");
    else if(k[0]=='a') system("mkg qw");
    system("dot a.dot -Tpng -o a.png\n");
    if(w){
        char link[100],hhead[100],nnext[100];
        sprintf(link,"mkdir %d",w);
        system(link);system("\n");
        sprintf(link,"copy a.png %d",w);
        system(link);system("\n");
        sprintf(link,"copy a.in %d",w);
        system(link);system("\n");
        system("del a.png");
    }
    return 0 ;
}